home *** CD-ROM | disk | FTP | other *** search
- #ifndef FWPOLYSH_H
- #define FWPOLYSH_H
-
- //========================================================================================
- //
- // File: FWPolySh.h
- // Release Version: $ 1.0d11 $
- //
- // Copyright: © 1995 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWSHAPE_H
- #include "FWShape.h"
- #endif
-
- #ifndef FWRECT_H
- #include "FWRect.h"
- #endif
-
- #ifndef FWPOLY_H
- #include "FWPoly.h"
- #endif
-
- #ifndef FWGCONST_H
- #include "FWGConst.h"
- #endif
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export on
- #endif
-
- //========================================================================================
- // Forward Declarations
- //========================================================================================
-
- class FW_CLASS_ATTR FW_CGraphicContext;
-
- //========================================================================================
- // class FW_CPolygonShape
- //========================================================================================
-
- class FW_CLASS_ATTR FW_CPolygonShape : public FW_CShape
- {
- public:
- FW_DECLARE_CLASS
-
- //---------------------------------------------------------------------------------------
- // Constructors/Destructors
- //
- public:
- FW_CPolygonShape(const FW_PPolygon& polygon,
- FW_ERenderVerbs renderVerb,
- FW_Boolean autoCloseFrame,
- const FW_PInk& ink = FW_kNormalInk,
- const FW_PStyle& style = FW_kNormalStyle);
-
- FW_CPolygonShape(const FW_CPolygonShape& other);
- FW_CPolygonShape(FW_CReadableStream& archive);
-
- virtual ~FW_CPolygonShape();
-
- //----------------------------------------------------------------------------------------
- // Operators
- //
- public:
- FW_CPolygonShape& operator=(const FW_CPolygonShape& other);
-
- //---------------------------------------------------------------------------------------
- // New API
- //
- public:
- void SetAutoCloseFrame(FW_Boolean autoCloseFrame);
- FW_Boolean GetAutoCloseFrame() const;
-
- //---------------------------------------------------------------------------------------
- // Inherited API
- //
- public:
- // ----- Rendering -----
- virtual void Render(FW_CGraphicContext& gc) const;
-
- // ----- Hit Testing -----
- virtual FW_Boolean HitTest(FW_CGraphicContext& gc,
- const FW_CPoint& test,
- FW_CFixed tolerance) const;
-
- // ----- Copying -----
- virtual FW_CShape* Copy() const;
-
- // ----- Transform -----
- virtual void Transform(Environment *ev, ODTransform* transform);
- virtual void InverseTransform(Environment *ev, ODTransform* transform);
-
- virtual void MoveShape(FW_CFixed deltaX, FW_CFixed deltaY);
- virtual void MoveShapeTo(FW_CFixed x, FW_CFixed y);
-
- virtual void Inset(FW_CFixed x, FW_CFixed y);
-
- // ----- Geometry -----
- virtual void GetBounds(FW_CGraphicContext& gc, FW_CRect& rect) const;
-
- // ----- Flatten -----
- virtual void Flatten(FW_CWritableStream& archive) const;
-
- //---------------------------------------------------------------------------------------
- // New API
- //
- public:
- // ----- Rendering -----
- static void RenderPolygon(FW_CGraphicContext& gc,
- const FW_PPolygon& polygon,
- FW_ERenderVerbs renderVerb,
- FW_Boolean autoCloseFrame,
- const FW_PInk& ink = FW_kNormalInk,
- const FW_PStyle& style = FW_kNormalStyle);
-
- // ----- Archiving -----
- static void* Read(FW_CReadableStream& archive);
-
- // ----- Geometry -----
- void GetGeometry(FW_PPolygon& polygon) const;
- void SetGeometry(const FW_PPolygon& polygon);
-
- //---------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- FW_PPolygon fPolygon;
- FW_Boolean fAutoCloseFrame;
- };
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export off
- #endif
-
- #endif // FWPOLYSH_H
-